
package com.app.bimo.module_accounts.mvp.model.model;


import com.app.bimo.commonbusiness.BuildConfig;
import com.app.bimo.commonbusiness.bean.BaseResult;
import com.app.bimo.commonbusiness.network.RetrofitServiceManager;
import com.app.bimo.library_db.UserData;
import com.app.bimo.module_accounts.mvp.constract.LoginContract;
import com.app.bimo.module_accounts.mvp.model.api.service.AccountService;
import com.app.bimo.module_accounts.mvp.model.entiy.CodeHelpData;
import com.app.bimo.module_accounts.mvp.model.entiy.OtherResult;

import androidx.collection.ArrayMap;
import io.reactivex.Observable;

public class LoginUserModel implements LoginContract.Model {


    @Override
    public void onDestroy() {

    }


    @Override
    public Observable<BaseResult<OtherResult>> login(ArrayMap<String,String> map) {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).login( map);

    }
    @Override
    public Observable<BaseResult<UserData>> getUserInfo() {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).getUserInfo();

    }

    @Override
    public Observable<BaseResult<Object>> getCode(String mobile, int type) {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).getCode(mobile, type);

    }

    @Override
    public Observable<BaseResult<OtherResult>> phoneRegister(ArrayMap<String,String> map) {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).phoneRegister(map);

    }

    @Override
    public Observable<BaseResult<CodeHelpData>> getCodeHelp() {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID,AccountService.class).getCodeHelp();
    }


}
